package com.example.demo.service;

import com.example.demo.mapper.KlassMapper;
import com.example.demo.model.Klass;
import com.example.demo.model.Student;
import com.example.demo.repository.KlassRepository;
import com.example.demo.repository.StudentRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Component;

import java.util.List;


@Component
public class KlassService {
    @Autowired
    private KlassMapper klassMapper;



    public List<Klass> findAll()
    {
        return klassMapper.findAll();

    }

    public void deleteById(String id){
        System.out.println(id);
        klassMapper.deleteById(id);
    }

    public void save(Klass k){
        klassMapper.save(k);
    }

    public Klass getReferenceById(String id){
        return klassMapper.getReferenceById(id);
    }

    public void update(Klass k){
        klassMapper.update(k);
    }
}